<?php
error_reporting(0);
$isadmin=1;
include_once '../comm/config.php';
include '../comm/checkpostandget.php';
include 'check.php';
$dengji=$_POST['dengji']; 
$money=$_POST['money']; 
$ymoney = $_POST['ymoney'];
$email=$_POST['email']; 
$qq=$_POST['qq'];
$mobile=$_POST['mobile'];
$pwd=$_POST['ddpassword']; 
$zfb=$_POST['zfb']; 
$tbusername=$_POST['tbusername']; 
$ddusername=$_POST['ddusername']; 
$tjr=$_POST['tjr']; 
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
     die(ERR_DB);
}
mysql_select_db($dbname);

mysql_query("set names utf8");
if($pwd=="duoduo123.com")
{
$q = "update ".$BIAOTOU."user set tbusername='$tbusername',zfb='$zfb',dengji='$dengji',money='$money',email='$email',qq='$qq',mobile='$mobile',tjr='$tjr' where ddusername='".$ddusername."'";
//echo $q;
mysql_query($q);
}
else
{
$pwd=md5($pwd);
$q = "update ".$BIAOTOU."user set ddpassword='$pwd',tbusername='$tbusername',zfb='$zfb',dengji='$dengji',money='$money',email='$email',qq='$qq',mobile='$mobile',tjr='$tjr' where ddusername='".$ddusername."'";
//echo $q;
mysql_query($q);
if(UC==1){
    include '../data/config.inc.php';
    include '../uc_client/client.php';
	$uc_name=iconv("utf-8","utf-8",$ddusername);
    $ucresult = uc_user_edit($uc_name,'',$_POST['ddpassword'],'',1);
	if($ucresult<0){
		echo "失败,错误编号：".$ucresult;
	    exit;
	}
}
}
header('Location: userlist.php');     

mysql_close($link);

?>
